<template>
	<view class="bg">
		<view class="p15 card">
			<view class="content" v-for="item in list" :key="item.title" @click="onLink(item.url,0)">
				<view class="grid">
					<view class="title">{{item.title}}</view>
					<view class="text-right"><image style="width: 20rpx;" src="https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/right.png" mode="widthFix" /></view>
				</view>
				<text class="text">{{item.text}}</text>
			</view>
		</view>
		<view class="p15">
			<image class="mt15" @click="onLink('/pages/advertisement/advertisement',item.id)" v-for="item in dataInfo" :key="item.id" style="width: 100%;height: auto;" :src="item.banner" mode="widthFix"></image>
		</view>
		<view class="text-center">
			<image class="mt15" style="width: 100%;height: auto;" src="https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/default-show.png" mode="widthFix"></image>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				list: [
					{title: '找资料',text: '海量资料，覆盖各种技能模块',extra: '查看',url:'/pages/information/index',avatar:'https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/config-information.png'},
					{title: '找工艺',text: '上万节点图集，逐步突破工艺难题',extra: '查看',url:'/pages/node/index',avatar:'https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/config-node.png'},
					{title: '找合作',text: '链接行业精英，打开圈层视野',extra: '查看',url:'/pages/cooperation/index',avatar:'https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/config-cooperate.png'},
					{title: '共享集采',text: '优选装饰材料，高品质高性价比',extra: '查看',url:'/pages/product/index',avatar:'https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/config-product.png'},
					{title: '找人才',text: '装饰人才精准触达，快速匹配',extra: '查看',url:'/pages/recruit/index',avatar:'https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/config-recruit.png'},
					{title: '找同行',text: '是同行者，是领路人，更是知心友',extra: '查看',url:'/pages/club/index',avatar:'https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/config-club.png'},
					// {title: '找课程',text: '学习进步，高品质高性价比课程',extra: '查看',url:'/pages/course/home/home',avatar:'https://xinzhu-1301398555.cos.ap-shanghai.myqcloud.com/wxapp/config-course.png'},
				],
				dataInfo:[],
			}
		},
		onShow() {
			this.onGetData()
		},
		methods: {
			onGetData(){
				let _this = this
				this.$request_api('applet_api/activity','GET').then(res => {
					_this.dataInfo = res.data
				}).catch(err => {
					console.log(err)
				})
			},
			onLink(url,id){
				let urls = url
				if(id){
					urls = url+"?id="+id
				}
				
				uni.navigateTo({
					url: urls
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.bg{background-color: #FFFFFF;position: absolute;height: 100%;width: 100%;}
	.grid{display: grid;grid-template-columns: 70% 30%;padding: 12px 0px;}
	.grid .title{font-size: 1.2rem;font-weight: 600;color: #4b4948;}
	.card{display: grid;grid-template-columns: 2fr 2fr;grid-gap: 8px;}
	.content{padding: 0px 12px 12px 12px;border: 1px solid #EEE;border-radius: 5px;background-color: #f5f5f5;}
	.text{font-size: .8rem;color: #b6b5ae;}
</style>
